package name.fowler.refactoring.simplestore;

import java.util.HashMap;

public class StatementResult {
	private HashMap<String, Double> movies = new HashMap<String, Double>();
	private int frequentRenterPoints;
	private String statementName;

	public StatementResult(String name) {
		statementName = name;
	}
	
	public void addMovie(String title, double amount) {
		movies.put(title, amount);
	}

	public int getFrequentRenterPoints() {
		return frequentRenterPoints;
	}

	public void setFrequentRenterPoints(int frequentRenterPoints) {
		this.frequentRenterPoints = frequentRenterPoints;
	}

	public double getTotalAmount() {
		double totalAmount = 0;
		for (String title : movies.keySet()) {
			double thisAmount = movies.get(title);
			totalAmount += thisAmount;
		}
		
		return totalAmount;
	}
}
